package cn.wolfcode.crm.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Calendar;
import java.util.Date;
@Getter
@Setter
public class ClientTransferQueryObject extends QueryObject{
    //创建开始时间
    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startTime;
    //结束时间
    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;


    public void setEndTime(Date endDate) {
        if (endDate != null) {

            Calendar cal = Calendar.getInstance();
            cal.setTime(endDate);
            cal.add(Calendar.DATE, 1);
            cal.add(Calendar.SECOND, -1);
            this.endTime = cal.getTime();
        } else {
            this.endTime = endTime;
        }

    }

    //客户名称
    private String clientName;
    //操作人员名称
    private String transUserRealName;
    //原市场专员名称
    private String oldSellerRealName;
    //现市场专员名称
    private String newSellerRealName;
    //
    private int start;

}
